/*
 Navicat Premium Data Transfer

 Source Server         : 127.0.0.1
 Source Server Type    : MySQL
 Source Server Version : 50725
 Source Host           : localhost:3306
 Source Schema         : blog

 Target Server Type    : MySQL
 Target Server Version : 50725
 File Encoding         : 65001

 Date: 03/01/2021 22:04:27
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for article
-- ----------------------------
DROP TABLE IF EXISTS `article`;
CREATE TABLE `article` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `author` varchar(20) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '作者',
  `title` varchar(40) COLLATE utf8_bin NOT NULL COMMENT '标题',
  `des` varchar(255) COLLATE utf8_bin DEFAULT NULL COMMENT '简介',
  `content` text COLLATE utf8_bin NOT NULL COMMENT '内容',
  `cover` varchar(255) COLLATE utf8_bin NOT NULL COMMENT '封面(一般是链接地址)',
  `eyes` bigint(20) DEFAULT NULL,
  `is_deleted` tinyint(1) NOT NULL DEFAULT '0',
  `create_id` bigint(20) DEFAULT '0',
  `create_name` varchar(20) COLLATE utf8_bin DEFAULT '',
  `create_time` bigint(20) DEFAULT NULL,
  `update_id` bigint(20) DEFAULT '0',
  `update_name` varchar(20) COLLATE utf8_bin DEFAULT '',
  `update_time` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
-- Table structure for article_category
-- ----------------------------
DROP TABLE IF EXISTS `article_category`;
CREATE TABLE `article_category` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(40) COLLATE utf8_bin NOT NULL,
  `des` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  `create_id` bigint(20) DEFAULT NULL,
  `create_time` bigint(20) DEFAULT NULL,
  `create_name` varchar(20) COLLATE utf8_bin DEFAULT NULL,
  `update_id` bigint(20) DEFAULT NULL,
  `update_time` bigint(20) DEFAULT NULL,
  `update_name` varchar(20) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
-- Table structure for article_tag
-- ----------------------------
DROP TABLE IF EXISTS `article_tag`;
CREATE TABLE `article_tag` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `name` varchar(40) COLLATE utf8_bin DEFAULT '' COMMENT '标签名称',
  `create_id` bigint(20) DEFAULT '0' COMMENT '创建者id',
  `create_name` varchar(40) COLLATE utf8_bin DEFAULT '' COMMENT '创建者名称',
  `update_id` bigint(20) DEFAULT '0' COMMENT '更新者id',
  `update_name` varchar(40) COLLATE utf8_bin DEFAULT '' COMMENT '更新者名称',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='文章对应标签表';

-- ----------------------------
-- Records of article_tag
-- ----------------------------
BEGIN;
INSERT INTO `article_tag` VALUES (6, 'admin', 0, '', 0, '');
INSERT INTO `article_tag` VALUES (7, 'admin', 0, '', 0, '');
INSERT INTO `article_tag` VALUES (8, 'admin', 0, '', 0, '');
INSERT INTO `article_tag` VALUES (9, 'admin', 0, '', 0, '');
INSERT INTO `article_tag` VALUES (10, 'admin', 0, '', 0, '');
COMMIT;

-- ----------------------------
-- Table structure for rl_article_category
-- ----------------------------
DROP TABLE IF EXISTS `rl_article_category`;
CREATE TABLE `rl_article_category` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `article_id` bigint(20) DEFAULT NULL,
  `article_category_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

-- ----------------------------
-- Table structure for rl_article_tag
-- ----------------------------
DROP TABLE IF EXISTS `rl_article_tag`;
CREATE TABLE `rl_article_tag` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `article_id` bigint(20) DEFAULT NULL,
  `article_tag_id` bigint(20) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


DROP TABLE IF EXISTS `article_comment`;
CREATE TABLE `article_comment` (
  `id` bigint(20) NOT NULL,
  `article_id` bigint(20) NOT NULL COMMENT '文章id',
  `parent_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '父级id',
  `content` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '评论内容',
  `create_id` bigint(20) DEFAULT NULL,
  `create_time` bigint(20) DEFAULT NULL,
  `create_name` varchar(255) COLLATE utf8_bin DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='文章评论表';

SET FOREIGN_KEY_CHECKS = 1;
